<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="java.util.List"%>
    <%@page import="org.jmu.entity.Upload"%>
<!DOCTYPE html>

<html>
<%  
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>  
<base href="<%=basePath%>">
<head>
  <meta charset="utf-8">
  <title>Layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="<%=path%>/views/static/layui-v2.5.6/layui/css/layui.css"  media="all">
	  <style type="text/css">
 .a-upload {
    padding: 4px 10px;
    height: 20px;
    line-height: 20px;
    position: relative;
    cursor: pointer;
    color: #888;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    *display: inline;
    *zoom: 1
}

.a-upload  input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
    filter: alpha(opacity=0);
    cursor: pointer
}

.a-upload:hover {
    color: #444;
    background: #eee;
    border-color: #ccc;
    text-decoration: none
}
  </style>
</head>
<body id="bd" background="views/static/imgs/bg2.png" style="background-repeat: no-repeat;background-size: 100% 100%;background-attachment: fixed;">

<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
  <button data-method="notice" class="layui-btn layui-btn-radius" onclick="window.location.href='views/static/background.html'" style="position:absolute;left: 7px;top: 7px;"><i class="layui-icon"></i>返回首页</button>
</div>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
  <legend>上传中心</legend>
</fieldset>
 
<div class="layui-tab layui-tab-card">
  <ul class="layui-tab-title">
  
  	<li></li>
  	<li></li>
  	<li></li>
  	<li></li>
  	<li></li>
    <li class="layui-this"><span style="font-size: large;font-weight: bolder;font-family: 宋体;">开始上传</span></li>
    <li><span style="font-size: large;font-weight: bolder;font-family: 宋体;">上传记录</span></li>
  </ul>
  <div class="layui-tab-content" style="height: 460px;">
  
    <div class="layui-tab-item layui-show">
    		<div style="position:absolute;left: 450px;top:160px;background-color:rgba(255, 255, 255, 0.7);">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<form class="layui-form" lay-filter="example" action="controller/upload" method="post"  enctype="multipart/form-data">
  <div class="layui-form-item">
    <label class="layui-form-label">我的角色</label>
    <div class="layui-input-block" style="width: 230px;">
      <select name="interest" lay-filter="aihao">
        <option value="Senior" selected>学长/学姐</option>
        <option value="Examinee">考生</option>
        <option value="Administrator" disabled>管理员</option>
      </select>
    </div>
  </div>
  
  
  <div class="layui-form-item">
    <label class="layui-form-label">上传人</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="upload_person" lay-verify="title" autocomplete="off" value="<%=session.getAttribute("customize_name") %>" class="layui-input" readonly>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">就读院校</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="now_college" lay-verify="title" autocomplete="off" value="<%=session.getAttribute("now_college") %>" class="layui-input" readonly>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">手机号</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="phonenumber" lay-verify="title" autocomplete="off" value="<%=session.getAttribute("uname") %>" class="layui-input" readonly>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">资料类型</label>
    <div class="layui-input-block" style="width: 230px;">
      <select name="file_type" lay-filter="aihao">
        <option value="政治" selected>政治</option>
        <option value="英语一" >英语一</option>
        <option value="英语二" >英语二</option>
        <option value="其他外国语" >其他外国语</option>
        <option value="数学一" >数学一</option>
        <option value="数学二" >数学二</option>
        <option value="数学三" >数学三</option>
        <option value="其他数学类" >其他数学类</option>
        <option value="专业课" >专业课</option>
        <option value="复试" >复试</option>
        <option value="调剂" >调剂</option>
      </select>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">文件</label>
    <div class="layui-input-block" style="width: 230px;">
      <a href="javascript:;" class="a-upload">
    	<input type="file" name="file" id="">点击这里上传文件
      </a>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">描述信息</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="desc1" placeholder="请输入必要的补充信息" lay-verify="title" autocomplete="off" class="layui-input">
    </div>
  </div>
  
  <div class="layui-form-item layui-form-text">
    <div class="layui-input-block" style="width: 300px;">
    </div>
  </div>
 
  <div class="layui-form-item" style="position: absolute;top: 400px;left:50px;">
    <div class="layui-input-block">
      <input type="submit" value="立即上传" class="layui-btn layui-btn-radius">
    </div>
  </div>
  
  
</form>
</div>
    </div>
    <div class="layui-tab-item">2</div>
    <div class="layui-tab-item">3</div>
    <div class="layui-tab-item">4</div>
    <div class="layui-tab-item">5</div>
    <div class="layui-tab-item">
    		<div class="layui-tab-item layui-show">
    		<div style="position:absolute;left: 450px;top:160px;background-color:rgba(255, 255, 255, 0.7);">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<form class="layui-form" lay-filter="example" action="controller/upload" method="post"  enctype="multipart/form-data">
  <div class="layui-form-item">
    <label class="layui-form-label">我的角色</label>
    <div class="layui-input-block" style="width: 230px;">
      <select name="interest" lay-filter="aihao">
        <option value="Senior" selected>学长/学姐</option>
        <option value="Examinee">考生</option>
        <option value="Administrator" disabled>管理员</option>
      </select>
    </div>
  </div>
  
  
  <div class="layui-form-item">
    <label class="layui-form-label">上传人</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="upload_person" lay-verify="title" autocomplete="off" value="<%=session.getAttribute("customize_name") %>" class="layui-input" readonly>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">就读院校</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="now_college" lay-verify="title" autocomplete="off" value="<%=session.getAttribute("now_college") %>" class="layui-input" readonly>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">手机号</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="phonenumber" lay-verify="title" autocomplete="off" value="<%=session.getAttribute("uname") %>" class="layui-input" readonly>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">资料类型</label>
    <div class="layui-input-block" style="width: 230px;">
      <select name="file_type" lay-filter="aihao">
        <option value="政治" selected>政治</option>
        <option value="英语一" >英语一</option>
        <option value="英语二" >英语二</option>
        <option value="其他外国语" >其他外国语</option>
        <option value="数学一" >数学一</option>
        <option value="数学二" >数学二</option>
        <option value="数学三" >数学三</option>
        <option value="其他数学类" >其他数学类</option>
        <option value="专业课" >专业课</option>
        <option value="复试" >复试</option>
        <option value="调剂" >调剂</option>
      </select>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">文件</label>
    <div class="layui-input-block" style="width: 230px;">
      <a href="javascript:;" class="a-upload">
    	<input type="file" name="file" id="">点击这里上传文件
      </a>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">描述信息</label>
    <div class="layui-input-block" style="width: 26	0px;">
      <input type="text" name="desc1" placeholder="请输入必要的补充信息" lay-verify="title" autocomplete="off" class="layui-input" placeholder="上传文件为其他或者专业课，加以说明！	">
    </div>
  </div>
  
  <div class="layui-form-item layui-form-text">
    <div class="layui-input-block" style="width: 300px;">
    </div>
  </div>
 
  <div class="layui-form-item" style="position: absolute;top: 400px;left:50px;">
    <div class="layui-input-block">
      <input type="submit" value="立即上传" class="layui-btn layui-btn-radius">
    </div>
  </div>
  
  
</form>
</div>
    </div>
    </div>
    <div class="layui-tab-item">
    		<div class="layui-form">
  <table class="layui-table">
    <colgroup>
      <col width="100">
      <col width="100">
      <col width="150">
      <col width="100">
      <col width="150">
    </colgroup>
    <thead>
      <tr>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">上传人</span></th>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">就读院校</span></th>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">文件名</span></th>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">资料类别</span></th>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">补充信息</span></th>
      	<th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">操作</span></th>
      </tr> 
    </thead>
    <tbody>
    <% List<Upload> uploadlist1 = (List)session.getAttribute("uploadlist1");%>
    <%if(uploadlist1!=null){ %>
    <%for(int i=0;i<uploadlist1.size();i++){ %>
      <tr>
        <td><%=uploadlist1.get(i).getUpload_person() %></td>
        <td><%=uploadlist1.get(i).getNow_college() %></td>
        <td><%=uploadlist1.get(i).getFilename() %></td>
        <td><%=uploadlist1.get(i).getFile_type() %></td>
        <td><%=uploadlist1.get(i).getDesc1() %></td>
        <td><a href="controller/deleteUploadbyfilename?filename=<%=uploadlist1.get(i).getFilename() %>"><span class="layui-badge">删除</span></a></td>
      </tr>
       <%} %>
      <%} %>
    </tbody>
  </table>
</div>
    <div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
  <button data-method="notice" class="layui-btn layui-btn-radius layui-btn-danger" style="position: relative;left: 30px;"><i class="layui-icon"></i>清空历史记录</button>
</div>	
    </div>
  </div>
</div>     

   
       
<script src="<%=path%>/views/static/layui-v2.5.6/layui/layui.all.js" charset="utf-8"></script>
<script>
layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
  
  //触发事件
  var active = {
    tabAdd: function(){
      //新增一个Tab项
      element.tabAdd('demo', {
        title: '新选项'+ (Math.random()*1000|0) //用于演示
        ,content: '内容'+ (Math.random()*1000|0)
        ,id: new Date().getTime() //实际使用一般是规定好的id，这里以时间戳模拟下
      })
    }
    ,tabDelete: function(othis){
      //删除指定Tab项
      element.tabDelete('demo', '44'); //删除：“商品管理”
      
      
      othis.addClass('layui-btn-disabled');
    }
    ,tabChange: function(){
      //切换到指定Tab项
      element.tabChange('demo', '22'); //切换到：用户管理
    }
  };
  
  $('.site-demo-active').on('click', function(){
    var othis = $(this), type = othis.data('type');
    active[type] ? active[type].call(this, othis) : '';
  });
  
  
  
});
</script>

<script>
layui.use('layer', function(){ //独立版的layer无需执行这一句
  var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
  
  //触发事件
  var active = {
    notice: function(){
      //示范一个公告层
      layer.open({
        type: 1
        ,title: false //不显示标题栏
        ,closeBtn: false
        ,area: '300px;'
        ,shade: 0.5
        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
        ,btn: ['是的，确定', '再考虑考虑']
        ,btnAlign: 'c'
        ,moveType: 1 //拖拽模式，0或者1
        ,content: '<div style="padding: 50px; line-height: 22px; background-color: white; color:black; font-weight: 400;font-size:18px;">真的要清除所有的历史记录吗？</div>'
        ,success: function(layero){
          var btn = layero.find('.layui-layer-btn');
          btn.find('.layui-layer-btn0').attr({
            href: 'user_basic.jsp'
            
          });
        }
      });
    }
  };
  
  $('#layerDemo .layui-btn').on('click', function(){
    var othis = $(this), method = othis.data('method');
    active[method] ? active[method].call(this, othis) : '';
  });
  
});
</script>

</body>
</html>